SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = object_id('dbo.lib_list_book_by_card'))
	DROP PROCEDURE dbo.lib_list_book_by_card
GO

CREATE PROCEDURE dbo.lib_list_book_by_card
	@card_no nvarchar(20)
AS
BEGIN
	SET NOCOUNT ON;
	
	Select borrow_id, book.book_no, category, title, press, publish_year, author, price, total, stock 
	From book, borrow
	Where (borrow.card_no = @card_no) and borrow.book_no = book.book_no
	Order by book.book_no;

END
GO